import { makeAutoObservable } from 'mobx';
import { observer } from 'mobx-react-lite';
interface props {
  textKey: string;
  textValue: string;
  isCompelte: string;
  editHistory: object;
}

let project = JSON.parse(`
{
  "name": "Test",
  "author": ["wuming123"],
  "description": "Test Project",
  "language": { "rawLanguage": 0, "newLanguage": 1 },
  "LICENSE": 0,
  "createDate": "2020-2-20 10:53:51",
  "lastVisitDate": "2020-2-20 10:53:51",
  "lastEditDate": "2020-2-20 10:53:51",
  "fileGroup": [
    {
      "name": "wuming123",
      "file": [
        {
          "name": "Test",
          "lastEditDate": "2020-2-20 10:53:51",
          "content": [
            {
              "itemKey": "BionicTacticalImplant.label",
              "rawText": "仿生大脑芯片",
              "translateText": "",
              "isComplete": false
            },
            {
              "itemKey": "BionicTacticalImplant.description",
              "rawText": "将先进的仿生计算机完美地植入人类的大脑中。",
              "translateText": "",
              "isComplete": false
            },
            {
              "itemKey": "ElectronicTacticalImplant.label",
              "rawText": "电子大脑芯片",
              "translateText": "",
              "isComplete": false
            },
            {
              "itemKey": "ElectronicTacticalImplant.description",
              "rawText": "带有与大脑间接口的先进计算机。",
              "translateText": "",
              "isComplete": false
            }
          ]
        }
      ],
      "child": [
        {
          "name": "wuming123",
          "file": [
            {
              "name": "Test",
              "lastEditDate": "2020-2-20 10:53:51",
              "content": [
                {
                  "itemKey": "BionicTacticalImplant.label",
                  "rawText": "仿生大脑芯片",
                  "translateText": "",
                  "isComplete": false
                },
                {
                  "itemKey": "BionicTacticalImplant.description",
                  "rawText": "将先进的仿生计算机完美地植入人类的大脑中。",
                  "translateText": "",
                  "isComplete": false
                },
                {
                  "itemKey": "ElectronicTacticalImplant.label",
                  "rawText": "电子大脑芯片",
                  "translateText": "",
                  "isComplete": false
                },
                {
                  "itemKey": "ElectronicTacticalImplant.description",
                  "rawText": "带有与大脑间接口的先进计算机。",
                  "translateText": "",
                  "isComplete": false
                }
              ]
            }
          ],
          "child": []
        },
        {
          "name": "wuming1232",
          "file": [
            {
              "name": "Test",
              "lastEditDate": "2020-2-20 10:53:51",
              "content": [
                {
                  "itemKey": "BionicTacticalImplant.label",
                  "rawText": "仿生大脑芯片",
                  "translateText": "",
                  "isComplete": false
                },
                {
                  "itemKey": "BionicTacticalImplant.description",
                  "rawText": "将先进的仿生计算机完美地植入人类的大脑中。",
                  "translateText": "",
                  "isComplete": false
                },
                {
                  "itemKey": "ElectronicTacticalImplant.label",
                  "rawText": "电子大脑芯片",
                  "translateText": "",
                  "isComplete": false
                },
                {
                  "itemKey": "ElectronicTacticalImplant.description",
                  "rawText": "带有与大脑间接口的先进计算机。",
                  "translateText": "",
                  "isComplete": false
                }
              ]
            }
          ],
          "child": []
        }
      ]
    }
  ]
}

`);

class mobxStore {
    constructor() {
    makeAutoObservable(this);
  }
  testProject?: any;
  currentTranslateItem?: any;
  currentFile?: any;

  // @observable isHide: boolean = false;
  private isHide: boolean = false;
  getHide() {
    return this.isHide;
  }
  setHide(value: boolean) {
    this.isHide = value;
  }
}
class test {
  hide = false;

  constructor() {
    makeAutoObservable(this);
  }
  public toogleHide(value:boolean) {
    this.hide = value;
  }
}

const store = new mobxStore();
const abcd = new test();
store.testProject = project;
store.currentTranslateItem = project['fileGroup'][0]['file'][0]['content'];
export default { store: store, test: abcd };
